
public class SavingsAccount extends AbstractAccount {
	/**
	 * The interest rate to use for the calculateInterest method.
	 */
	private static double interestRate = 1.25;
	
	/**
	 * Constructs a new savings account for this owner.
	 * @param owner
	 */
	public SavingsAccount(Person owner)
	{
		super(owner);
	}
	
	/**
	 * Calculates the accounts new balance after compound interest is applied.
	 */
	public void calculateInterest()
	{
		setBalance(getBalance() + (getBalance() * interestRate / 100));
	}
	
	/* (non-Javadoc)
	 * @see AbstractAccount#withdrawal(double)
	 */
	public boolean withdrawal(double amount)
	{
		boolean withdrawalSuccessful = false;
		if(!((getBalance() - amount) < 0))
		{
			setBalance(getBalance() - amount);
			withdrawalSuccessful = true;
		}
		return withdrawalSuccessful;
	}
	
	
	
	/**
	 * Prints the state of the savings account.
	 */
	public void print()
	{
		System.out.println("**************************************");   // should be static strings at the top
		System.out.println("Savings account:     " + getAccountNumber());
		System.out.println("Account holder name: " + getOwner().getName());
		System.out.println("Address:             " + getOwner().getStreet());
		System.out.print("                     " + getOwner().getZipCode());
		System.out.println(" " + getOwner().getTown());
		System.out.println(getOwner().getfCountry().toUpperCase());
		System.out.println("**************************************");
		System.out.println("Balance:  " + getBalance());
		System.out.println("**************************************");
	}
		
}
